import request from '@/utils/request'
export default {
  /**
   * 获取数据
   * @param {} data
   * @param {*} pageSize
   * @param {*} current
   * @returns
   */
  queryByPhone(data, pageSize, current) {
    return request({
      url: `user/user/member/queryByPhone/${pageSize}/${current}`,
      method: 'post',
      data: data
    })
  },
  /**
   * 审核
   * @param {*}} id
   * @returns
   */
  checkMember(id) {
    return request({
      url: `user/user/member/${id}`,
      method: 'put'
    })
  },
  /**
   * 根据id获取用户数据
   * @param {*} id
   * @returns
   */
  getDataById(id) {
    return request({
      url: `user/user/member/${id}`,
      method: 'get'
    })
  },
  /**
   * 修改用户数据
   * @param {*} data
   * @returns
   */
  updateUser(data) {
    return request({
      url: `user/user/member/`,
      method: `put`,
      data: data
    })
  },
  /**
   * 删除用户
   * @param {*}} id
   * @returns
   */
  deleteUserById(id) {
    return request({
      url: `user/user/member/${id}`,
      method: 'delete'
    })
  },
  /**
   * 添加用户
   * @param {*} data
   * @returns
   */
  addUser(data) {
    return request({
      url: `user/user/member/`,
      method: 'post',
      data: data
    })
  },
  /**
   * 根据用户id查询及其姓名所对应的地址信息
   * @param {*} data
   * @param {*} pageSize
   * @param {*} current
   * @returns
   */
  queryAddressBookBasedOnUserId(data, pageSize, current) {
    return request({
      url: `user/user/address-book/queryAddressBookBasedOnUserId/${pageSize}/${current}`,
      method: 'post',
      data: data
    })
  },
  /**
   * 设置为默认地址
   * @param {*}} data
   * @returns
   */
  changeTheDefaultAddress(data) {
    return request({
      url: `user/user/address-book/changeTheDefaultAddress`,
      method: 'put',
      data: data
    })
  },
  /**
   * 删除地址
   * @param {*} id
   * @returns
   */
  deleteAddressById(id) {
    return request({
      url: `user/user/address-book/${id}`,
      method: 'delete'
    })
  },
  /**
   * 根据地址id获取地址信息
   * @param {*} id
   * @returns
   */
  getAddressDataById(id) {
    return request({
      url: `user/user/address-book/${id}`,
      method: 'get'
    })
  },
  /**
   * 修改地址
   * @param {*} data
   * @returns
   */
  updateAddressDataById(data) {
    return request({
      url: `user/user/address-book/`,
      method: 'put',
      data: data
    })
  },
  /**
   * 添加地址信息
   * @param {*} data
   * @returns
   */
  addAddress(data) {
    return request({
      url: `user/user/address-book/`,
      method: 'post',
      data: data
    })
  }
}
